package com.gdwhomework.chapter07.homework004;

public class Scientist extends Person{
    private double bonus;

    public Scientist(String name, int age, char gender, double sal, double bonus) {
        super(name, age, gender, sal);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void showAllYearSal() {
        System.out.print("科学家"+getName()+"的全年工资：");
        System.out.println(getSal()*12+getBonus());
    }
}
